<template>
	<view class="shop-empty flex flex-column">
		<u-empty :mode="modeType.mode" :text="modeType.text" :icon="modeType.icon">
		</u-empty>
		<u-button v-if="modeType.btn.show" type="primary" color="#01ab36" shape="circle" :text="modeType.btn.text"></u-button>
	</view>

</template>
<script>
	import empty from "./props.js"
	export default {
		name: "unt-empty",
		mixins: [empty],
		computed: {
			modeType() {
				if (this.type === 'cart') {
					return {
						mode: 'car',
						icon: 'http://cdn.uviewui.com/uview/empty/car.png',
						text: '购物车为空,快去逛逛吧!',
						btn:{show:true,text:"去逛逛"}
					}
				} else if (this.type === 'data') {
					return {
						mode: 'data',
						icon: 'http://cdn.uviewui.com/uview/empty/data.png',
						text: '数为空,请换一个吧!'
					}
				} else if (this.type === 'cate') {
					return {
						mode: 'data',
						icon: 'http://cdn.uviewui.com/uview/empty/data.png',
						text: '该分类下没有商品,请换一个吧!'
					}
				} else if (this.type === 'address') {
					return {
						mode: 'address',
						icon: 'http://cdn.uviewui.com/uview/empty/address.png',
						text: '地址为空,快去添加吧!',
						btn:{show:false,text:"去添加"}
					}
				} else if (this.type === 'search') {
					return {
						mode: 'search',
						icon: 'http://cdn.uviewui.com/uview/empty/search.png',
						text: '没有搜索结果哦!'
					}
				} else if (this.type === 'order') {
					return {
						mode: 'order',
						icon: 'http://cdn.uviewui.com/uview/empty/order.png',
						text: '没有订单,快去购买吧!'
					}
				} else if (this.type === 'coupon') {
					return {
						mode: 'coupon',
						icon: 'http://cdn.uviewui.com/uview/empty/coupon.png',
						text: '没有优惠劵!'
					}
				}
			}
		}
	}
</script>